FROM openjdk:8-jdk-alpine
RUN echo -e http://mirrors.ustc.edu.cn/alpine/v3.12/main/ > /etc/apk/repositories
RUN apk add ttf-dejavu
ARG JAR_FILE
ENV PROFILE prod
ENV JAVA_OPTS  -Xmx1024m -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=768m -Xss2m
ADD /cicadasmall-launcher/target/cicadasmall-launcher.jar /opt/cicadasmall-launcher.jar
EXPOSE 80
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -Dspring.profiles.active=${PROFILE} -jar /opt/cicadasmall-launcher.jar
